
<section id="product_ads" style="display: block;">
	<header>
		<h1>Sản phẩm Mua sắm</h1>
		<p>giới thiệu bởi 
			<a href="http://123.vn" title="123.vn">123.vn</a>
			và 
			<a href="http://123mua.vn" title="">123Mua.vn</a>
		</p>
	</header>
	<ul class="products">
		<?php 
			if($products_ads){
				foreach ($products_ads as $ads) {
		?>
			<li class="item">
				<div class="thumbnail" style="background-image: url(<?=$ads->image?>)"></div>
				<h1><a href="<?=$ads->link?>" title="<?=$ads->ads_name?>"><?=$ads->ads_name?></a></h1>
				<p class="price">
					<label>Giá:</label>
					<?=$ads->price?>
				</p>
			</li>
		<?php
				}
			}
		?>
	</ul>
	<script type="text/javascript">
		var products = $('#product_ads .item');
		if ($(products).length <= 4) {
			$('#product_ads item').show();
			$('#product_ads').show();
		} else {
			var display = [];
			while (display.length < 4) {
				i = Math.floor(Math.random() * $(products).length);
				if (display.indexOf(i) == -1) display.push(i);
			}
			for (var i = 0, j = display.length; i < j; i++) {
				$($(products)[display[i]]).show();
			};
			$('#product_ads').show();
		}
	</script>
</section>
<footer>
	<div class="wrapper">

		<nav class="categories">
			<ul>
				<?php 
					if($categories){
						foreach ($categories as $cate) { 
				?>
				<li class="parent <?=$cate->class?>">
					<a href="<?=base_url().$cate->category_links?>"><?=$cate->class;?></a>
					<?php if($sub_categories){
					?>
					<div class="subcate">
						<ul>
							<?php 
								foreach ($sub_categories as $subcate){
									if($subcate->category_id == $cate->category_id){
							?>
							<li>
								<a href="<?=base_url().$cate->class.'/'.$subcate->sub_category_links?>"><?=$subcate->sub_category_name;?></a>
							</li>
							<?php }
								}
							?>
						</ul>
					</div>
					<?php }?>
				</li>
			<?php
					}
				}
			?>
			</ul>
		</nav>


		<div class="copyright">
			<div class="logo">
				<a href="http://news.zing.vn">
					<img src="http://stc.v3.news.zing.vn/images/zing_footer_logo.jpg" width="130" width="55" />
				</a>
				<br>
				&copy; Copyright ZING.VN, All rights reserved.
				<br>
				Ghi nguồn ZING.VN khi phát hành lại thông tin từ website này.
			</div>
			<p class="info vcard">
				<a href="mailto:toasoan@news.zing.vn" style="color: #555;">toasoan@news.zing.vn </a>| 0985.57.88.55
				<br />
				<a href="http://news.zing.vn/infopages/toa-soan.html">Thông tin tòa soạn </a>&bull;
				<a href="http://ads.vng.com.vn/rate-card#tabs-2#Zing-News-PR-Article">Quảng cáo </a>&bull;
				<a href="http://vng.com.vn/vn/tuyen-dung/">Tuyển dụng </a>
			</p>
		</div>
	</div>
</footer>
</div>
<div id="toolbox">
	<ul>
		<li class="toTop"><a href="#top" title="Lên đầu trang"><span>Lên đầu trang</span></a></li>
		<li class="email"><a href="mailto:toasoan@news.zing.vn" title="Gửi email"><span>toasoan@news.zing.vn</span></a></li>
		<li class="phone"><a href="javascript:alert('Thông tin phản hồi cho tòa soạn qua đường dây nóng 0985.57.88.55');" title="Điện thoại nóng"><span>0985.57.88.55</span></a></li>
	</ul>
</div>
</body>
</html>
